package com.xyw.code.platform.webapps.rest;

import com.xyw.code.bus.common.entity.form.SendMessageForm;
import com.xyw.code.bus.common.feign.SendMessageRemoteApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 数据库管理 前端控制器
 * </p>
 *
 * @author xyw
 * @since 2020-02-07
 */
@Api(value="数据库api")
@RestController
@RequestMapping("/sysDb")
public class SysDbController {

    @Autowired
    private SendMessageRemoteApi sendMessageRemoteApi;

    private static final ThreadLocal<String> contextHolder = new ThreadLocal();


    @RequestMapping("/test")
    @ApiOperation(value = "数据库api", notes = "数据库api")
    public String test(HttpServletRequest request){
        SendMessageForm sendMessageForm = new SendMessageForm("aaaaa","BOOT-EXCHANGE-2","boot1.1",null,null);
        sendMessageRemoteApi.sendMessage(sendMessageForm);
        return "成功了";
    }
}

